//
//  GCD.swift
//  HeadlineNews
//
//  Created by han on 2019/6/5.
//  Copyright © 2019 han. All rights reserved.
//

import Foundation

extension DispatchQueue {
    //优先级 userInteractive > default > unspecified > userInitiated > utility > background
    static var userInteractive: DispatchQueue { return DispatchQueue.global(qos: .userInteractive) }
    static var userInitiated: DispatchQueue { return DispatchQueue.global(qos: .userInitiated) }
    static var unspecified: DispatchQueue { return DispatchQueue.global(qos: .unspecified) }
    static var utility: DispatchQueue { return DispatchQueue.global(qos: .utility) }
    static var background: DispatchQueue { return DispatchQueue.global(qos: .background) }
    func after(_ delay: TimeInterval, execute closure: @escaping () -> Void ) { asyncAfter(deadline: .now() + delay, execute: closure) }
    
}
